package com.org.platform.utils.rabbitmq;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import java.util.Date;

public class TopicProducer {
    public static void main(String[] args) throws Exception {
        String message = "hello当前时间为：" + new Date().toString();
        String changeName = "topicExchange";
        Channel channel = Producer.getChannel();
        channel.exchangeDeclare(changeName, BuiltinExchangeType.TOPIC, true, false, null);
        channel.queueDeclare("Q_TOPIC", true, false, false, null);
        channel.queueBind("Q_TOPIC", changeName, "Q1");
        channel.basicPublish(changeName, "", null, message.getBytes());
        channel.close();
        System.out.println("hello world");
    }


}
